package com.example.demo.controller;

import com.example.demo.service.IndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 * @author youshang
 * @date 2021/02/18 17:55
 **/
@RestController
@RequestMapping("/index")
public class IndexController {

    @Autowired
    private IndexService indexService;

    @RequestMapping("/p")
    public String pIndex(String record){
        String s = indexService.producerIndexMessage(record);
        return "hello world!" + s;
    }

    @RequestMapping("/c")
    public String cIndex(String record){
        String s = indexService.consumerIndexMessage(record);
        return "hello world!" + s;
    }
}
